//
//  FMNewLessonTableViewCell.m
//  PsychologyFM
//
//  Created by lanou on 16/1/12.
//  Copyright © 2016年 ZhangLuDu. All rights reserved.
//

#import "FMNewLessonTableViewCell.h"
#import <UIImageView+WebCache.h>

@implementation FMNewLessonTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _fmImgView = [[UIImageView alloc]initWithFrame:CGRectMake(15, 10, 60, 60)];
        [self.contentView addSubview:_fmImgView];
        _titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(_fmImgView.right + 10, _fmImgView.top, kScreenWidth - 100 , 25)];
        _titleLabel.font = [UIFont systemFontOfSize:14];
        [self.contentView addSubview:_titleLabel];
        
        _speakLabel = [[UILabel alloc]initWithFrame:CGRectMake(_titleLabel.left, _titleLabel.bottom + 10, _titleLabel.width, _titleLabel.height)];
        _speakLabel.font = [UIFont systemFontOfSize:14];
        [self.contentView addSubview:_speakLabel];
    
    }
    return self;
}

-(void)setModel:(FMLessonAndFMModel *)model
{
    _model = model;
    [_fmImgView sd_setImageWithURL:[NSURL URLWithString:model.cover] placeholderImage:nil completed:nil];
    _titleLabel.text = model.title;
    _speakLabel.text = model.speak;
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
